package com.alipay.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    public static String app_id = "2021000117627848";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key ="MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCIA4N7pbWygqOBgttuy3nn5t1iCa5XjNHQeVGKng65jA2cecTjqI15vb69v34hCHLu4XMjRwsL+YXAIuLPG92KOkk0DUGUPGHzB5O2vEXu9q1f3omMYiw8247M/gmrw6himXXluO53uFHq7wvcpACby+Xm4gUJfc4n+MMUhVqxVmQZ8RVGt+aZQFV4aB6hyYNmAMRqs+6U+y9Yn/9uVCvDvCYlrphdudrascSR499V4cU8C/Z/I8AOFw1lNsVaYQFb6A9EMT3Do/qiaOeoTEYP2kTfX/qiI8OVtviw5rBCdm2Ha9zufJbrmbOHO2dyQG6dtZYYAu2VsgPP3h8N2hHZAgMBAAECggEAJk8vCnWbHsNzADh2S9ed53Z8Jm/pnhk4w4pYMD3ikdpjvw4BKcpAxuhtwA4enXk+vg/cGTSaZO4MARkSXxlPJe7SzYlqTjFPuV8J+O9Al1T9ckJA5byFD0McDpsC6FE8rUDiFykmaawNzqkz4xqCXV9pysUgfBLmLRYBBFenOsla2IK/q3GiNarOOTpUp2fGKeNsbs/g1QgOZE9bnnUO2zmitGTPy72vSzJqrfQtq5C8wxPPVtU5z+tyRxa69ZTzXArbJSgRY7+kw4xn86Neu/+i+xmZYo8xTjCp5eymK7tg9u+0881Babzt3Txi61Ld7ovLl1PapHw1t1a+AmDJ/QKBgQDdGooLakpAttgZXzdDHJ+85JAx9VlmerWDyqj/xLDn23SpcAX6xNOMxhSAbx1ayBHWExHA6c8pEKVBhupoepgw+O7DgRwKQCNBT7ru6cQEMsvsHwQSWOLTaDzoLGDLCskuJxW3BoPxM3dj00VIllDQ0cgCv5RYah0lw5ASqXZsvwKBgQCdewE9nas3I8Fz60AdVIi2Nvih2Wk8vfbnliaYu494cASdJdWaRmcWjWnigoMfKhPivIRnY+w4R435fRDL7eryBJvqjpnm64teLRDOWPDEA9PSU7ReRxwiBBfqV9vPU90q7f6jj+5BvaYjPPAV52+eqiJUaHxQILXp1CiVpdLvZwKBgB/onpd7JXAlcxZmSWFkFiF6ktzC3b4OY3e7nZwb1LQBVdrGEfbYxPcB9x956bCaQwi0A9HlbEIu5sqIH/goCSK4Ki0IyvUnwG7ChOXJ0sIQWqGe8EV9km6UEoYnMWjcC6Cff2DEjfIXTVmYudz55HveapEK+OuxlLdIe9hVoIOdAoGAN1MvbGYn8IcvP3o2XBeGr/0//BxVTHGwfEvT43SBQt6XwF26XSi+rr2fpWQUjK5Lrixsl6YTJvJ8flnhvMMo9z2HSTAwAWBe5gcPEG9Opo5xrEKb60MwLwMhI8MaBgyAdsSF4RB/s7jc1SRjdE6KeENtLBpJEh1ry2otl+VZ5aECgYAxJJUSlB6eQm/W6oBIx8KYB7MY3/i+5l6DswIaCQ4blG86pzdKd3Ee3h197jkS5i4/rg3REcAk23di3kOvjhkZeYJCgWtnfrBsfJ+sCjkxKzLIvNTAhF2ERnldSsil0wNgcnyP6x41RpZGmyYBIWOwLrw7OTTG15JOwgufw0KUGw==";
    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key ="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA22XOpS+KuZYCwH9/1BCM/E5HES1wyZYnR1i4+v1TlP3R8Kt0QnZTbXoHfmaPN+SWAHyC+W9PxQddn54d6iLRqy8IYliWu/7yvjQU6KF9At+Vouqo+Qa579t9+VvnCwxOS+CkwM8R/ai30XVTUM8JMURo3eWU3aKOZjfj7r1MIYXA85P/6ZD5rbl82K+kW2eBORaWiffZMrSg8oyJterBi4YU2udvKdQFWbpuo6WEH5u34L30/fMgBo5vBIxvTyBqbIC4LHYKQcu0WJ49sRjBs8KDrTZCWdrHAC9+67IYL6noh4KaaCh/w6r+mQcA9MglrD7kp2y3szolKXPoR5VKuwIDAQAB";
    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://6d9wykzmxq.52http.tech/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://6d9wykzmxq.52http.tech/alipay.trade.page.pay-JAVA-UTF-8/return_url.jsp";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl ="https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     *
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis() + ".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

